package com.sysu.homework.action;

import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.opensymphony.xwork2.ActionSupport;
@Component("logoutAction")
@Scope("prototype")
public class LogoutAction extends ActionSupport{

	@Override
	public String execute() throws Exception {
		HttpSession session = ServletActionContext.getRequest().getSession();
		session.setAttribute("user", null);
		session.setAttribute("role", null);
		return "success";
	}

}
